<script lang="ts">
import Tabulation from "../assembling_plugins/Tabulation.svelte";
// import {message} from 'antd';
// import {queryLoginLog, removeLoginLog} from './service';

import DrawerCenter from "../assembling_plugins/DrawerCenter.svelte";



/**
 *  删除节点
 * @param selectedRows
 * : TableListItem[]
 */
// const handleRemove = async (selectedRows) => {
//     const hide = message.loading('正在删除');
//     if (!selectedRows) return true;
//     try {
//         await removeLoginLog({
//             ids: selectedRows.map((row) => row.id),
//         });
//         hide();
//         message.success('删除成功，即将刷新');
//         return true;
//     } catch (error) {
//         hide();
//         message.error('删除失败，请重试');
//         return false;
//     }
// };

const columns = [
    {
        title: '用户名',
        dataIndex: 'userName',
    },
    {
        title: 'IP地址',
        dataIndex: 'ip',
    },
    {
        title: '登录时间',
        dataIndex: 'loginTime',
        sorter: true,
        hideInSearch: true,
    },
    {
        title: '登录状态',
        dataIndex: 'status',
        hideInSearch: true,
    },
    {
        title: '状态',
        dataIndex: 'status',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建人',
        dataIndex: 'createBy',
        hideInSearch: true,
    },
    {
        title: '创建时间',
        dataIndex: 'createTime',
        sorter: true,
        hideInSearch: true,
    }
];

// const ids = {
//     pageSize: 1,
//     current: 10
// };
const datalistRs = columns;//queryLoginLog(ids);

let drawerCenter = false;

const DrawerCenterOnClick = () => {
    drawerCenter = true;
}
let label = "用户名";
let name = "userName";
</script>
<svelte:head>
    <title>登录日志</title>
    <meta name="description" content="用户登录日志" />
</svelte:head>


<div><button on:click={DrawerCenterOnClick}>显示</button></div>


<Tabulation datalist="{datalistRs}" column="{columns}" on:helloparent={() => {
    //const id = {id:e.detail};
    //handleRemove(id);
}} />

<DrawerCenter drawerCenter="{drawerCenter}" on:drawerCenterOnClickFalse={(n) =>{
    drawerCenter = n.detail;
}} />



